//
//  aRSetting.h
//  DuoBaoKnigh
//
//  Created by 陈柱成 on 16/8/25.
//  Copyright © 2016年 aReu. All rights reserved.
//

#ifndef aRSetting_h
#define aRSetting_h

#import "AppDelegate.h"
//测试
//#define Test
#define LoginTest

#define aRAPPLICATION [UIApplication sharedApplication]
#define aRdelegate    ((AppDelegate *)[[UIApplication sharedApplication] delegate])

#define aR_WIDTH  [UIScreen mainScreen].bounds.size.width
#define aR_HEIGHT [UIScreen mainScreen].bounds.size.height
#define aR_SIZE   CGSizeMake(aR_WIDTH *2/3,aR_WIDTH *2/3)
#define aR_MaxY   CGRectGetMaxY(self.navigationController.navigationBar.frame)

#define aR_Image(name) [UIImage imageNamed:name]
#define Color(r,g,b)   [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

#define SINGLE_LINE_WIDTH  (1 / [UIScreen mainScreen].scale)//1px

//路径
#define CACHES [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]
#define aRDEFAULT [NSUserDefaults standardUserDefaults]
#define aRFILE [NSFileManager     defaultManager]

#define LoadView(name) [[[NSBundle mainBundle] loadNibNamed:name owner:nil options:nil] lastObject]
#define aRNibLoad(name) [UINib nibWithNibName:name bundle:nil]

#define aRFont [UIFont systemFontOfSize:13.0f]
#define aRCustomFont(g) [UIFont systemFontOfSize:g]
#define aRFontsize 11.0f
#define seleTiT 14.0f
#define CellFontSize 12.0f

#define aRUrl(url) [NSURL URLWithString:url]

/**
 *  颜色分类
 */
#define aR_BGColor [UIColor hexStringToColor:@"#EFEFF4" :1.0f]
#define IndexTinColor [UIColor hexStringToColor:@"#FE524B" :1.0f]//首页状态栏
//进度条背景颜色
#define progressBG [UIColor hexStringToColor:@"#FDADA1" :1.0f]
//包含按钮以及文字颜色
#define progBigBtnCol [UIColor hexStringToColor:@"#FE524B" :1.0f]
//部分页面状态栏颜色
#define baRTinColor [UIColor hexStringToColor:@"#ffffff":1.0f]
//购物车按钮 再次购买按钮
#define ShopBtnCol [UIColor hexStringToColor:@"#FE524B":1.0f]
//细线分割颜色
#define CellJiangeCol [UIColor hexStringToColor:@"dadada":1.0]

/*
    字体颜色
 */
//一级标题商品
#define ShopNameCol [UIColor hexStringToColor:@"#333333":1.0]
//入口标注文字&进度条状态
#define FuBiaoTiCol [UIColor hexStringToColor:@"#666666":1.0]
//提示性文字，输入框提示文字
#define TipsCol [UIColor hexStringToColor:@"#999999":1.0]
//标签栏文字以及未选中图标
#define UnSelCol [UIColor hexStringToColor:@"#929292":1.0]
//用户昵称和人数
#define PeoNameCol [UIColor hexStringToColor:@"#3273C3":1.0]
//获得商品状态提示  详情
#define GetProDuctCol [UIColor hexStringToColor:@"#5CC933":1.0]//绿色
//获得商品状态提示球颜色
#define GetProTipCol [UIColor hexStringToColor:@"#DB3652":1.0]
//商品详情按钮"立即购买"
#define ProBuyCol [UIColor hexStringToColor:@"#434242":1.0]//黑色

#define aRMutArr(arrCount) arrCount?arrCount:0
#define aRect(height) CGRectMake(0, 0, aR_WIDTH, height)
#define TOKEN @"LoginToken"
#define isTOKEN [aRDEFAULT valueForKey:TOKEN]
//#define aRWeakSelf __weak typeof(self) weakSelf = self;
#define  CURRENT_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
#define USER_DEFAULT [NSUserDefaults standardUserDefaults]
#define F_MAN [NSFileManager defaultManager]
#define aRUTF8(str) [NSString stringWithCString:[str UTF8String] encoding:NSUnicodeStringEncoding]
#define NSCenter [NSNotificationCenter defaultCenter]
#define aRVersion [[UIDevice currentDevice] systemVersion].floatValue


#ifdef DEBUG
#define aReuRelease(X) [X release];
#define debugLog(...)    NSLog(__VA_ARGS__)
#define debugMethod()    NSLog(@"%s", __func__)
#define debugError()     NSLog(@"Error at %s Line:%d", __func__, __LINE__)
#else
#define aReuRelease(X)  [X release],X = nil;
#define debugLog(...)
#define debugMethod()
#define debugError()
#endif



#endif /* aRSetting_h */
